#include<bits/stdc++.h>
using namespace std;
int main() {
  int n; cin>>n;
  while(n--) {
    long long num; cin>>num;
    if(num%2) { // odd
      if(num>0) cout<<num/2<<' '<<num/2+1<<'\n';
      else cout<<num/2-1<<' '<<num<<'\n';
    }
    else if (num==0) {
      cout<<"-1 1\n";
    }
    else {
      if(num>0) cout<<-(num-1)<<' '<<num<<'\n';
      else cout<<num<<' '<<-num+1<<'\n';
    }
  }
}
